import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;


public class VendingMachineItemTest {

	@Before
	public void setUp() throws Exception {
		
		
	}
	 

	@After
	public void tearDown() throws Exception {
	}

	@Test (expected=VendingMachineException.class)

	public void testVendingMachineItem() throws VendingMachineException{
		VendingMachineItem t1 = new VendingMachineItem("chips", 1.50);	//I tested the construct of VMItem, When I wrote case2 changed 1.50 to -1, it failed.
		VendingMachineItem t2 = new VendingMachineItem("milk", -1);	//Test if price less than 0		
		
	}		
	
	
	@Test
	public void testGetName() {		
		VendingMachineItem it0 = new VendingMachineItem("chips", 1.50); 
		assertEquals("chips", it0.getName());							//test the getName function can get the same as input
	}

	@Test
	public void testGetPrice() {
		VendingMachineItem it0 = new VendingMachineItem("chips", 1.50);
		assertEquals(1.50, it0.getPrice(), 0.0000);						////test the getPrice function can get the same as input
	}

}
